package com.ddc.study.entity;

import com.google.gson.annotations.SerializedName;

import java.util.List;

import androidx.annotation.NonNull;

/**
 * Created on 2018/5/17.
 *
 * @author lshun
 * @version 1.0
 */
public class MainData<T> {
    @SerializedName("curPage")
    private int mCurPage;
    @SerializedName("datas")
    private List<T> mData;
    @SerializedName("offset")
    private int mOffset;
    @SerializedName("over")
    private boolean mOver;
    @SerializedName("pageCount")
    private int mPageCount;
    @SerializedName("size")
    private int mSize;
    @SerializedName("total")
    private int mTotal;


    /**
     * 判断数据是否已经加载完
     *
     * @return 若已经加载完毕返回true 否则返回false
     */
    public boolean isDataLoadOver() {
        return mOver;
    }

    public int getCurPage() {
        return mCurPage;
    }

    public void setCurPage(int curPage) {
        mCurPage = curPage;
    }

    public List<T> getData() {
        return mData;
    }

    public void setData(List<T> data) {
        mData = data;
    }

    public int getOffset() {
        return mOffset;
    }

    public void setOffset(int offset) {
        mOffset = offset;
    }

    public boolean isOver() {
        return mOver;
    }

    public void setOver(boolean over) {
        mOver = over;
    }

    public int getPageCount() {
        return mPageCount;
    }

    public void setPageCount(int pageCount) {
        mPageCount = pageCount;
    }

    public int getSize() {
        return mSize;
    }

    public void setSize(int size) {
        mSize = size;
    }

    public int getTotal() {
        return mTotal;
    }

    public void setTotal(int total) {
        mTotal = total;
    }

    @NonNull
    @Override
    public String toString() {
        return "MainData{" +
                "mCurPage=" + mCurPage +
                ", mData=" + mData +
                ", mOffset=" + mOffset +
                ", mOver=" + mOver +
                ", mPageCount=" + mPageCount +
                ", mSize=" + mSize +
                ", mTotal=" + mTotal +
                '}';
    }
}
